#ifndef QQTDATACONVERTER_H
#define QQTDATACONVERTER_H

#include <QObject>
#include <qqthighgrade_global.h>

/**
 * @brief The QQtDataConverter class
 * UNICODE为核心的转码工具
 */
class QQTHIGHGRADESHARED_EXPORT QQtDataConverter : public QObject
{
    Q_OBJECT

public:
    explicit QQtDataConverter ( QObject* parent = 0 );
    virtual ~QQtDataConverter();

    void fromGBK ( const QByteArray& bytes );
    QByteArray toGBK ( );

    void fromUTF8 ( const QByteArray& bytes );
    QByteArray toUTF8 ( );

    void fromEncoding ( const QByteArray& bytes, QByteArray encoding = QByteArray ( "UTF-8" ) );
    QByteArray toEncoding ( QByteArray encoding = QByteArray ( "UTF-8" ) );

protected:

private:
    QByteArray mBytes;
};

#endif // QQTDATACONVERTER_H

